import Mock from 'mockjs'

const mock = [
  {
    url: "/dev-api/list/get",
    delay: 1000,
    method: 'get',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: '返回数据内容'
      }
    }
  },
  {
    url: "/dev-api/list/error",
    delay: 1000,
    method: 'post',
    response: () => {
      return {
        code: 400,
        msg: '错误测试',
        data: null
      }
    }
  },
  {
    url: "/dev-api/oa/newspaper/open/listNewspaper",
    delay: 1000,
    method: 'get',
    response: () => {
      let data = []
      for (let i = 0; i < 100; i++) {
        data.push({
          newspaperId: i,
          title: `2024年第${100 - i}期`,
          cover: 'http://www.zhenshijituan.com.cn/2024/10/images/24-1001_02.gif'
        })
      }
      return {
        code: 200,
        msg: '成功',
        data
      }
    }
  },
  {
    url: "/dev-api/oa/newspaper/open/listPageByNewspaperId",
    delay: 1000,
    method: 'get',
    response: () => {
      let data = []
      let articleList = []
      articleList.push({
        articleId: 1,
        title: '文章一',
        linkStartX: 20,
        linkStartY: 100,
        linkWidth: 460,
        linkHeight: 660,
      })
      for (let i = 0; i < 4; i++) {
        data.push({
          id: i,
          cover: 'http://www.zhenshijituan.com.cn/2024/10/images/24-1001_02.gif',
          articleList
        })
      }
      return {
        code: 200,
        msg: '成功',
        data
      }
    }
  }
]

export default mock
